// 封装所有频道接口方法
import request from '@/utils/request.js'

/**
 *全部频道
 * @returns
 */
export const getAllChannels = () => {
  return request({
    method: 'GET',
    url: '/v1_0/channels'
  })
}

/**
 *添加频道
 * @param {*} obj {id:'',seq:''}
 * @returns promise
 */
export const addChannels = obj => {
  return request({
    method: 'PATCH',
    url: '/v1_0/user/channels',
    data: {
      channels: [obj]
    }
  })
}

/**
 *删除数据
 * @param {*} target 删除需要的ID
 * @returns promise
 */
export const deleteAllChannels = target => {
  return request({
    method: 'DELETE',
    url: '/v1_0/user/channels/' + target
  })
}
